<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改盟主引流特别奖励')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-bounty-edit" th:object="${specialBounty}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">首次购机数量：</label>
                <div class="col-sm-8">
                    <input name="numbers" th:field="*{numbers}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">引流奖励：</label>
                <div class="col-sm-8">
                    <input name="sumMoney" th:field="*{sumMoney}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">奖励期限(显示)：</label>
                <div class="col-sm-8">
                    <input name="bountyMonthShow" th:field="*{bountyMonthShow}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">奖励期限（隐藏）：</label>
                <div class="col-sm-8">
                    <input name="bountyMonthHide" th:field="*{bountyMonthHide}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "bounty/bounty";
        $("#form-bounty-edit").validate({
            rules:{
                numbers:{
                    required:true,
                    digits:true,
                    min:1
                },
                sumMoney:{
                    required:true,
                    number:true,
                    min:0
                },
                bountyMonthShow:{
                    required:true,
                    digits:true,
                    min:0
                },
                bountyMonthHide:{
                    required:true,
                    digits:true,
                    min:0
                }
            },
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-bounty-edit').serialize());
            }
        }
    </script>
</body>
</html>